bookmarksmanager: Ignore delete events
authorMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 14:41:57 +0000 (10:41 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 15:48:32 +0000 (11:48 -0400)
Surpisingly, when a monitored file gets atomically replaced
with g_file_set_contents(), the file monitor reports a
DELETED event for the temp file, which is not the file
I'm monitoring.

Just ignore DELETED events.

Fixes: #3036
gtk/gtkbookmarksmanager.c

index 4fce669113c8ab6888e9ab78a9bf0d5257d24657..ed1ea063b34447fc924a7d91dbc1dd1ae8366372 100644 (file)
@@ -238,10 +238,10 @@ bookmarks_file_changed (GFileMonitor      *monitor,
     case G_FILE_MONITOR_EVENT_CHANGED:
     case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
     case G_FILE_MONITOR_EVENT_CREATED:
-    case G_FILE_MONITOR_EVENT_DELETED:
       g_file_load_contents_async (file, NULL, read_bookmarks_finish, manager);
       break;
 
+    case G_FILE_MONITOR_EVENT_DELETED:
     case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
     case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
     case G_FILE_MONITOR_EVENT_UNMOUNTED: